<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <meta charset="utf-8" />
        <title>用户登录-川小呆后台管理系统</title>
        <meta name="description" content="User login page" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
        <link rel="Bookmark" href="__ROOT__/favicon.ico" >
        <link rel="Shortcut Icon" href="__ROOT__/favicon.ico" />
        <!-- bootstrap & fontawesome必须的css -->
        <link rel="stylesheet" href="__PUBLIC__/ace/css/bootstrap.min.css" />
        <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" />
        <!-- ACE样式-->
        <link rel="stylesheet" href="__PUBLIC__/ace/css/ace.min.css" />
        <!--[if lte IE 9]>
        <link rel="stylesheet" href="__PUBLIC__/ace/css/ace-part2.min.css" />
        <![endif]-->

        <!--[if lte IE 9]>
        <link rel="stylesheet" href="__PUBLIC__/ace/css/ace-ie.css" />
        <![endif]-->
        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
        <script src="__PUBLIC__/others/html5shiv.min.js"></script>
        <script src="__PUBLIC__/others/respond.min.js"></script>
        <![endif]-->
        <style>
            .login-layout {
                background-image: url('__PUBLIC__/img/login.jpg');
                background-repeat: no-repeat;
                background-position: center;
                background-size: cover;
            }
        </style>
    </head>
    <body class="login-layout">
    <div class="back-img"></div>
        <div class="main-container">
            <div class="main-content">
                <div class="row" >
                    <div class="col-sm-10 col-sm-offset-1">
                        <div class="login-container">
                            <div class="space-6"></div>
                            <div class="position-relative">
                                <div id="login-box" class="login-box visible widget-box" style="padding: 0px;border-radius: 20px;margin-top: 20px">
                                    <div class="widget-body" style="border-radius: 20px">
                                        <div class="widget-main" style="border-radius: 20px">
                                            <!--<div class="center"><img src="__PUBLIC__/img/logo.png"></div>-->
                                            <h4 class="header blue lighter bigger text-center " style="font-weight: 400;border: 1px solid #8C5045">
                                                <img src="__PUBLIC__/img/chuan_.png" alt="">
                                            </h4>
                                            <div class="space-6"></div>
                                            <form  name="runlogin" id="runlogin" method="post" action="{:url('admin/Login/runlogin')}">
                                                <fieldset>
                                                    <label class="block clearfix">
                                                        <span class="block input-icon input-icon-right">
                                                            <input type="text" class="form-control" name="user_name" id="user_name" placeholder="用户名" value="{:session('userinfo.user_name')}" />
                                                            <i class="ace-icon fa fa-user"></i>
                                                        </span>
                                                    </label>

                                                    <label class="block clearfix">
                                                        <span class="block input-icon input-icon-right">
                                                            <input type="password" class="form-control" name="password" id="password" placeholder="输入密码" value="{:session('userinfo.password')}" />
                                                            <i class="ace-icon fa fa-lock"></i>
                                                        </span>
                                                    </label>

                                                    <div class="clearfix">
                                                        <!--
                                                        <label class="inline">
                                                            <input name="rememberme" type="checkbox" class="ace" />
                                                            <span class="lbl"> 记住信息</span>
                                                        </label>
                                                        -->

                                                        <button type="button" class="width-35 pull-right btn btn-sm btn-primary" id="submit">
                                                            <i class="ace-icon fa fa-key"></i>
                                                            <span class="bigger-110">登录</span>
                                                        </button>
                                                    </div>

                                                    <div class="space-4"></div>
                                                </fieldset>
                                            </form>
                                        </div><!-- /.widget-main -->
                                    </div><!-- /.widget-body -->
                                </div><!-- /.login-box -->
                            </div><!-- /.position-relative -->
                        </div>
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.main-content -->
        </div><!-- /.main-container -->

        <!-- 基本的js -->
        <!--[if !IE]> -->
        <script src="__PUBLIC__/others/jquery.min-2.2.1.js"></script>
        <!-- <![endif]-->
        <!-- 如果为IE,则引入jq1.12.1 -->
        <!--[if IE]>
        <script src="__PUBLIC__/others/jquery.min-1.12.1.js"></script>
        <![endif]-->
        <!-- jquery.form、layer、yfcmf的js -->
        <script src="__PUBLIC__/others/bootstrap.min.js"></script>
        <script src="__PUBLIC__/others/jquery.form.js"></script>
        <script src="__PUBLIC__/layer/layer_zh-cn.js"></script>
        <script src="__PUBLIC__/others/maxlength.js"></script>
        <script src="__PUBLIC__/yfcmf/yfcmf.js"></script>
        <script src="__PUBLIC__/ace/js/dog.js"></script>
        <script type="text/javascript">
            $(function(){
                $(document).bind('keydown',function(e){
                    var key = e.which;
                    if(key == 13){
                        $('#submit').click();
                    }
                })
            })

            var dogApplication = null;

            
            //登录
            $('#submit').on('click',function(){
                var url = $("#runlogin").attr('action');
                var user_name = $("#user_name").val();
                var password = $("#password").val();
                if(!user_name || user_name == ' '){
                    layer.tips('用户名必须填写！', '#user_name', {
                        tips: [1, '#FF9900'] //还可配置颜色
                    });
                    return false;
                }
                if(!password || password == ' '){
                    layer.tips('密码必须填写！', '#password', {
                        tips: [1, '#FF9900'] //还可配置颜色
                    });
                    return false;
                }
                var dog = LoginDemo(0);
                var doginfo = SessionInfoDemo_IE(dog);
                $.post(url,{user_name:user_name,password:password,doginfo:doginfo},function(result){
                    if (result.code == 1){
                        location.href = result.url; 
                    } else {
                        layer.alert(result.msg,{icon: 2,closeBtn: 0 }
                        );
                    }
                })
            })
        </script>
        <!-- 如果为触屏,则引入jquery.mobile -->
        <script type="text/javascript">
            if ('ontouchstart' in document.documentElement)
                document.write("<script src='__PUBLIC__/others/jquery.mobile.custom.min.js'>" + "<" + "/script>");
        </script>
    </body>
</html>
